#!/usr/bin/env bash
#### 1.1 产品新增修改字段 6 -> 8
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/fixProductForm -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","attr":"","frontDev":"1","xbbCode":"123456","businessType":2401}'

#### 1.2 仓库修改字段
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/initNewAll -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","attr":"text_70","frontDev":"1","xbbCode":"123456","businessType":1801,"operate":2,"afterAttr":"text_5"}'

#### 1.3 期初的索引
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataMapping -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","saasMark":1,"businessType":4800}'

#### 1.4 bom单字段调整
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/fixBomBillExplain -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","corpidList":[],"userId":"manager7218","platform":"web","frontDev":"1","saasMark":1,"xbbCode":123456,"businessType":2601,"attr":"array_2","fieldAttr":"showType","operate":1}'

#### 1.5 生产单字段调整
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/fixProductionOrderExplain -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","corpidList":[],"userId":"manager7218","platform":"web","frontDev":"1","saasMark":1,"xbbCode":123456,"businessType":2801,"attr":"array_4","fieldAttr":"showType","operate":1}'

#### 1.6 采购退货单字段调整
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/fixReturnedPurchaseForm -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.0 供应商产品增加单位值 改sql 10s
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/addUnitInfoToSupplierProduct -X POST -H 'Content-type:application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.0 sku冗余增量数据脚本
####curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addChildIds -X POST -H 'Content-type:application/json' -d '{"frontDev":"1","xbbCode":"123456","corpid":"ding45b220254ed2e97335c2f4657eb6378f","userId":"045813481726979391","platform":"web","saasMark":1,"fromProductSupplier":1}'
####curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addChildIds -X POST -H 'Content-type:application/json' -d '{"frontDev":"1","xbbCode":"123456","corpid":"ding45b220254ed2e97335c2f4657eb6378f","userId":"045813481726979391","platform":"web","saasMark":1,"fromProductSupplier":0}'


#### 2.1 供应商的spu关系转换为sku
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/productAssociationSupplier -X POST -H 'Content-type:application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.2 供应商增加名称 改sql
####curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addSupplierName -X POST -H 'Content-Type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.3 产品团队sku冗余增量脚本
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/incProductAssociationUser -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.4 更新当前数据库所有的仓库的期初状态 改sql
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/updateWarehouseOriStock -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.5 产品编号数据从data.text_2 刷到serialNo 改sql  产品
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/productNoAndSku -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.6 产品仓库信息 sku + spu id + name  考虑与2.7合并  产品
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addStockInfoToProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/fixParentProductDataWarehouse -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","userId":"manager7218","corpidList":[],"corpid": "dingf6576c4f7359fd1f","platform":"web","frontDev":"1"}'

#### 2.7 产品分仓全仓记录
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addAllStockInfo -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.6-2.7 （产品仓库信息 sku + spu id + name） + 产品分仓全仓记录
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addStockInfoToProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.8 更新是否还能退料入库的标识 HAS_RETURNED_MATERIEL 影响的数据库表有：tb_saas_production_order  提前刷，提前上代码兼容
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/fixProductionOrderReturnedFlag -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.9 采购退货单新增字段供应商 总数据241
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/returnPurchaseFixSupplier -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 2.10 产品数据es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":2401,"byCorpid":0}'

#### 2.11 仓库数据es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":1801,"byCorpid":0}'

#### 3.1 出入库拆分的开始 影响的数据库表有：tb_paas_menu
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/module/addStockMenu -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 3.2.1 复制老公司流程,影响的数据库表有 入库单：tb_paas_process_template
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/process/copyTemplate -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456","businessType":1406}'

#### 3.2.2 复制老公司流程,影响的数据库表有 出库单：tb_paas_process_template
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/process/copyTemplate -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456","businessType":1506}'

#### 3.3 将审批中的入库单 出库单类型type复制到外面来 影响的数据库表有：tb_paas_process_task tb_paas_process_data 是否可以sql执行
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/process/copyProcessType -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 3.4.1 根据type刷tb_saas_instock的appId,menu_id,form_id 需等待菜单初始化完成 影响的数据库表有：tb_saas_instock
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/fixStockFormData -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456","stockType":1}'

#### 3.4.1 根据type刷tb_saas_outstock的appId,menu_id,form_id 需等待菜单初始化完成 影响的数据库表有：tb_saas_outstock
#curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/fixStockFormData -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456","stockType":2}'

#### 3.4.1 入库单es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":1401,"byCorpid":0}'

#### 3.4.2 出库单es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":1501,"byCorpid":0}'


#### 3.5 将原先的1401，1501替换为1404，1504，1507，1505等具体的出入库单类型 影响的数据库表有：tb_chart
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/fixBiStockChart -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 4.1 选择产品字段
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/selectProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 4.2 期初选择产品字段
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/selectProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":["0"],"platform":"web","frontDev":"1","xbbCode":"123456","businessType":4800}'

#### 4.3 工单选择产品字段
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/selectWorkOrderProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456","businessType": null}'

#### 5.1 采购退货出库刷上游refId 增量改造
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addRefProductIdToReturnPurchaseOutstock -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 5.2 退货退款入库刷上游refId 增量改造
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/product/addRefProductIdToRefundInstock -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 5.3 工单产品数组存在null值修复 增量改造
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/fixNullArray -X POST -H 'Content-type: application/json' -d '{"corpid":"dingf6576c4f7359fd1f","userId":"manager7218","corpidList":[],"platform":"web","frontDev":"1","xbbCode":"123456"}'

#### 5.5 进销存拆分出入库单插入默认打印模板（需要先执行`product_print.sql`脚本）
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/module/addDefaultJXCPrintTemplate -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","userId":"manager7218","corpidList":[],"corpid": "dingf6576c4f7359fd1f","platform":"web","frontDev":"1"}'

### fix 25386 【紧急】产品关联仓库长度不能超过200
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fixData/fixWorkOrderExplain -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","userId":"manager7218","corpidList":[],"corpid": "dingf6576c4f7359fd1f","platform":"web","frontDev":"1","businessType":2401,"attr":"text_69","operate":1,"fieldAttr":"fieldType"}'


curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":"123456","corpid":"dingb8e0441ffb71260bbc961a6cb783455b","userId":"1","platform":"web","saasMark":1,"businessType":2403,"byCorpid":1}'

curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":"123456","corpid":"dingb8e0441ffb71260bbc961a6cb783455b","userId":"1","platform":"web","saasMark":1,"businessType":2404,"byCorpid":1}'
